<?php

class CartApi extends ApiBase
{
	private $mysql = null;

	public function __construct()
	{
		parent::__construct();
		$this->mysql = n_api('mysql')->cname('weixin');
	}

	public function getCartByPpid($ppid)
	{
		$query = "select wxid from cart_main where ppid = $ppid";
		$rs = $this->mysql->select($query);
		if (count($rs) == 0)
			return [];
		foreach ($rs as $value) {
			$cart[] = $value['wxid'];
		}
		return $cart;
	}
}